package com.maxima.maximaAttendance.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateOperations {

	public static int getTodaysDay()
	{
		Date dt= new Date();
		SimpleDateFormat sdf= new SimpleDateFormat("dd");
		return Integer.parseInt(sdf.format(dt));
	}
	public static int getCurrentMonth()
	{
		Date dt= new Date();
		SimpleDateFormat sdf= new SimpleDateFormat("MM");
		return Integer.parseInt(sdf.format(dt));
	}
	public static int getCurrentYear()
	{
		Date dt= new Date();
		SimpleDateFormat sdf= new SimpleDateFormat("yyyy");
		return Integer.parseInt(sdf.format(dt));
	}
	public static Date addDays(int x)
	{
		Calendar cal= Calendar.getInstance();
		cal.add(Calendar.DAY_OF_MONTH, x);
		return cal.getTime();
	}
	public static Date setDay(int x)
	{
		Date date= new Date();
		Calendar cal= Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.DATE, x);
		return cal.getTime();
	}
}
